package com.com.knowledgepaymentmanagementsystem.service.goods.impl;

import com.com.knowledgepaymentmanagementsystem.mapper.goods.GoodsMapper;
import com.com.knowledgepaymentmanagementsystem.pojo.goods.Goods;
import com.com.knowledgepaymentmanagementsystem.service.goods.GoodsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;
/**
 * @author DELL
 * @version 1.0
 * @description: TODO
 * @date 2025/9/22 15:53
 */
@Service
public class GoodsServiceImpl implements GoodsService {

    @Autowired
    private GoodsMapper goodsMapper;
    @Override
    public List<Goods> getGoods(Goods goods) {
        return goodsMapper.getGoods(goods);
    }

    @Override
    public Object insertGoods(Goods goods) {
        goods.setCreateTime(LocalDateTime.now());
        return goodsMapper.insert(goods);
    }
    @Override
    public void deleteGoods(Integer id) {
        goodsMapper.deleteById(id);
    }

    @Override
    public void updateGood(Goods goods) {
        goodsMapper.updateById(goods);
    }

}
